<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.doone.telmarket.domain.ibator.ServiceTypeExample"%>
<%@page import="com.doone.telmarket.domain.ibator.ServiceType"%>
<%@page import="com.doone.telmarket.domain.Service"%>
<%@ taglib prefix="se" uri="/WEB-INF/serviceTypeTag.tld"%>
	<%
		if(session.getAttribute("isAdminLogined")==null){
			return;
		}else{
			String isAddminLogined = session.getAttribute("isAdminLogined").toString();
			if(!("true".equals(isAddminLogined))){
				response.sendRedirect("login.jsp");
				return;
			}
		}
		
	%>
<%
response.addHeader("Cache-Control", "no-cache");
response.addHeader("Expires", "Thu, 01 Jan 1970 00:00:01 GMT");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.doone.telmarket.domain.ServiceProduct"%>
<%@page import="com.doone.telmarket.domain.ServicePage"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.HashMap"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>main</title>
<link rel="stylesheet" rev="stylesheet"
	href="${pageContext.request.contextPath}/css/admin/style-admin.css"
	type="text/css" media="all" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/ckeditor/ckeditor.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/ckeditor/ckeditor.js"></script>

<script src="${pageContext.request.contextPath}/js/jquery.js"
	type="text/javascript"></script>
<script
	src="${pageContext.request.contextPath}/js/jquery.ui.draggable.js"
	type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.alerts.js"
	type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/ajaxfileupload.js"
	type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/serviceOpration.js"
	type="text/javascript"></script>
<link href="${pageContext.request.contextPath}/css/jquery.alerts.css"
	rel="stylesheet" type="text/css" media="screen" />
	<script src="${pageContext.request.contextPath}/fckeditor/fckeditor.js"
	type="text/javascript"></script>
<style type="text/css">

.file{border:1px solid #333333;color:#666666;background:#eeeeee;font:normal 12px Tahoma;height:18px}
</style>
<script type="text/javascript">
			window.onload  = function(){
				var fom = document.getElementById("queryServiceForm");
				fom.onsubmit = function(){
					var value = document.getElementById("serviceCode").value;
					if(value!=""&&isNaN(value)){
						alert("请输入数字类型的增值业务代码");
						return false;
					}
					return true;
				}} 
		function getServiceById(value){
			var serviceId = document.getElementById("serviceQueryId").value=value;
			var form = document.getElementById("serviceIdForm");
			form.submit();
		}
	
   </script>
</head>
<body>

<div style="z-index: 1;height: 1000">

<div class="MainDiv"><input type="hidden" id="contextPath" value="${pageContext.request.contextPath}">
<table width="99%" border="0" cellpadding="0" cellspacing="0"
	class="CContent">
	<tr>
		<th class="tablestyle_title">增值业务管理</th>
	</tr>
	<tr>
		<td class="CPanel">
		<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
			<tr>
				<td align="left">&nbsp;&nbsp;&nbsp;<a href="${pageContext.request.contextPath}/admin/service/service.jsp">新增增值业务</a>
				<a href="${pageContext.request.contextPath}/admin/service/toOperationService.jsp">编辑增值业务</a></td>
			</tr>



			<tr align="center">
				<td class="TablePanel"></td>
			</tr>
			<tr>
				<TD width="100%">
				
				<fieldset style="height: 100%;"><legend>选择增值业务的服务类别及功能类别</legend>
				<form id="queryServiceForm" action="${pageContext.request.contextPath}/admin/queryServiceByServiceCodeAndServiceName" method="post">增值业务名称:<input type="text" value="" name="serviceName"/>
				增值业务代码：<input type="text" id="serviceCode" value="" name="serviceCode"/>
				提供商：<input type="text" value="" name="spName"/>
				<!--功能类别:<se:showServiceClassify />服务类别:<se:showServiceType />  --><input
					type="submit" id="query" value="查询" class="button" style="cursor: hand"></form>
				</fieldset>
				<fieldset style="height: 100%;" id="queryResult"><legend>查询结果</legend>
				<div id="serviceDiv" style="width: 80%">
				<form action="selectServicePageByServiceId" method="post" id="serviceIdForm">
					<input type="hidden" id="serviceQueryId" name="serviceId">
				</form>
				<table border="1px" id="serviceTab">
					
				
				<%
					if(request.getAttribute("serviceList")!=null){
						
						List<Service> serviceList = (ArrayList)request.getAttribute("serviceList");
						
						if(serviceList.size()!=0){
							%>
							<tr>
							<td width="150px">增值业务名称</td>
							<td width="150px">增值业务提供商</td>
							<td width="50px">操作</td>
							<td width="50px">操作</td>
							<td width="50px">操作</td>
							</tr>
							<%
							for(int i=0;i<serviceList.size();i++){
								%>
								
								<tr>
							<td width="100px"><%=serviceList.get(i).getServiceName() %></td>
							<td width="100px"><%=serviceList.get(i).getSpName() %></td>

					<!--  	<td width="50px"><span style="cursor: hand" 
							onclick="modifyService('<%=serviceList.get(i).getServiceCode() %>','<%=serviceList.get(i).getServiceName() %>','<%=serviceList.get(i).getSpName() %>','<%=serviceList.get(i).getServiceType().getServiceTypeId() %>')">编辑</span></td> -->	
							
							<td width="50px"><span style="cursor: hand" 
		   		onclick="getServiceById(<%=serviceList.get(i).getServiceCode() %>)">编辑</span></td>
							<td width="50px">
							<span style="cursor: hand" onclick="deleteById(<%=serviceList.get(i).getServiceCode() %>,'<%=serviceList.get(i).getServiceName() %>',this)">删除</span></td>
						<td width="50px">
							<span style="cursor: hand" ><a href="${pageContext.request.contextPath}/web/service/<%=serviceList.get(i).getServiceCode() %>.html" target="_blank">查看</a></span></td>
						</tr>
						
					
								<%
							}
						}else{
							%>
							<tr>
							<td width="400px">没有查询到数据
							</td>
							</tr>
							<%
						}
						
					}
				%>
				</table>
				</div>
				</fieldset>
				
				
			
			
				</TD>
			</TR>

		</TABLE>


		</td>
	</tr>
	<TR>
		<TD colspan="2" align="center" height="50px"></TD>
	</TR>
</TABLE>
</div></div>


</body>
</html>